home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / negvignette.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-27  |  4KB  |  131 lines

  1. /* NegVignette.rexx V2.0 -- Fade pic or clip edges to negative. */
  2. /* By Bob Caron © 1995 NewTek Inc.                              */
  3. /* Originaly by Arnie Cachelin                                  */
  4.  
  5. parse arg InClipName","OutClipName","StartField","EndField
  6.  
  7. Address "DigiPaint"
  8. options results
  9.  
  10.  
  11. screen=0
  12. if inclipname="" & outclipname="" then screen=1
  13. if screen=1 then do
  14.    startfield=1
  15.    endfield=1
  16.    outclipname="Test"
  17.    end
  18.  
  19. IFFBaseName=OutClipName
  20.  
  21. if ~show('l','rexxsupport.library') then do
  22.   if ~addlib('rexxsupport.library',0,-30,34) then do
  23.     exit
  24.   end
  25. end
  26.  
  27.  
  28. /* Reset Paint */
  29. 'Pmcl'
  30. 'Pot0' 0
  31. 'Pot1' 0
  32. 'Poth' $8000
  33. 'Potv' $8000
  34. 'Spoh' $8000
  35. 'Spov'
  36. /* End Of Reset*/
  37.  
  38. PageWide=752
  39. PageHigh=480
  40. dots=0
  41. XWin = 100
  42. YWin = 40
  43. Clear = d2c(12)
  44. nv = ''
  45. cr = '0a'x
  46. call getfontsize
  47.  
  48. wid = width*48
  49. hei = theight+height*10
  50.  
  51. if screen=0 then do
  52.    if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/NegVignette Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  53.        exit
  54.    end
  55. end
  56.  
  57. do Frame = StartField to (StartField+(EndField-StartField)/2)
  58.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  59.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  60.   call filter()                    /* Do The filter Thing...                 */
  61.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  62.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  63.   if screen=0 then call filter()   /* If this is a flyer clip do other field */
  64.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  65.   if screen=1 then 'Shco'          /* Render To Buffer (if this is screen processing)*/
  66.   end
  67. if screen=0 then 'Iclp'            /* Add an flyer icon to this clip */
  68. exit
  69.  
  70. filter:  /* Do a filter */
  71.  
  72. '8rgb' 255 255 255  /* White color */
  73. 'Pmxo'          /* XOR mode */
  74. 'Hvof'          /* Set to radial gradient off */
  75. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  76. 'Hvar'          /* Toggle radial gradient blend */
  77. 'Potv' $8000    /* Set hotspot center */
  78. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  79. 'Poth' $8000    /* Set hotspot  center */
  80. 'Minc'          /* Set Center transparency to 0% */
  81. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  82. 'Maxe'          /* Set Edge transparency to 100% */
  83. 'Whsc'          /* Fill Whole Screen */
  84.  
  85. return
  86.  
  87.  
  88. OpenWindow:
  89. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  90.   pdots="...."
  91.   dots=dots+1
  92.   if dots>4 then dots=1
  93.   call writech('Window',Clear||nv||cr)
  94.   call writech('Window','Current Source Clip ['InClipName']'cr)
  95.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  96.   call writech('Window',''cr)
  97.   call writech('Window','Current Frame: 'Frame/2''cr)
  98.   call writech('Window','    End Frame:'EndFrame/2''cr)
  99.   call writech('Window',''cr)
  100.   call writech('Window','Processing'right(pdots,dots)||cr)
  101.  
  102. return
  103.  
  104.  
  105. getfontsize:
  106.  
  107. if open('font','env:sys/font.prefs','R') then do
  108.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  109.    call close('font')
  110.    font = substr(font,index(font,'FONT')+4)
  111.    font = substr(font,index(font,'FONT')+4)
  112.    height = c2d(substr(font,29,2))
  113.    tfont = substr(font,index(font,'FONT')+4)
  114.    theight = c2d(substr(tfont,29,2))
  115.    font = substr(font,33)
  116.    font = left(font,index(font,d2c(0))-1-5)
  117.    if open('font','FONTS:'font'/'height,'R') then do
  118.       width = c2d(right(readch('font',116),2))
  119.       call close('font')
  120.   end
  121.   else if height=9 then width = 10
  122.                    else width = 8
  123. end
  124.   else do
  125.   theight = 8
  126.   height = 8
  127.   width = 8
  128. end
  129.  
  130. return
  131.